﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FXnaInfrastructure;

using FXnaWpfBase;

using NSApplication;

namespace NSPresentation
{
    public class ToolBarViewModel:FViewModel
    {



        public void Init()
        {
            GisService.CurrentService.MapModeChanged += new EventHandler(CurrentService_MapModeChanged);
        }


        void CurrentService_MapModeChanged(object sender, EventArgs e)
        {
            this.OnPropertyChanged("IsSelectON");

            this.OnPropertyChanged("IsPanOn");

            this.OnPropertyChanged("IsMoveOn");
            this.OnPropertyChanged("IsAddPointOn");

            this.OnPropertyChanged("IsAddBarrierOn");


        }




     


        public bool IsSelectON
        {
            get {

                return GisService.CurrentService.MapMode == MapMode.Select;
            }


        }


        public bool IsMoveOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.Move;
            }

 
        }

        public bool IsPanOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.Pan;
            }


        }




        public bool IsAddPointOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.AddPoint;
            }

 
        }


        //public bool IsAddLineOn
        //{
 
        //}

        public bool IsAddBarrierOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.AddBarrier;
            }


        }



       



    }
}
